//
//  KiwipenEvent.h
//  BlueToothDemo
//
//  Created by US bike on 2017/8/29.
//  Copyright © 2017年 奇异果. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef enum : NSUInteger {
    EventTypeError = 1, //无效指令1
    EventTypeButton,    //收到按键消息2
    EventTypePower,     //收到电量消息3
    //EventTypeLED,       //收到LED消息4
    EventTypeUUID,      //收到数据5
    
    //自定义事件
    EventTypeBLEConnected,
    EventTypeBLEDisConnected,
    
} EventType;

typedef enum : NSUInteger {
    EventDetailTypeVALUE_UP_BUTTON_FALLING_EDGE = 1,
    EventDetailTypeVALUE_UP_BUTTON_RISING_EDGE,//2
    EventDetailTypeVALUE_UP_BUTTON_SINGLE_CLICK,//3
    EventDetailTypeVALUE_UP_BUTTON_DOUBLE_CLICK,//4
    EventDetailTypeVALUE_UP_BUTTON_LONG_PRESS,//5
    EventDetailTypeVALUE_UP_BUTTON_LONG_RELEASE,//6
    
    EventDetailTypeVALUE_DOWN_BUTTON_FALLING_EDGE,//7
    EventDetailTypeVALUE_DOWN_BUTTON_RISING_EDGE,//8
    EventDetailTypeVALUE_DOWN_BUTTON_SINGLE_CLICK,//9
    EventDetailTypeVALUE_DOWN_BUTTON_DOUBLE_CLICK,//10
    EventDetailTypeVALUE_DOWN_BUTTON_LONG_PRESS,//11
    EventDetailTypeVALUE_DOWN_BUTTON_LONG_RELEASE,//12
    
    EventDetailTypeVALUE_MID_BUTTON_FALLING_EDGE,//13
    EventDetailTypeVALUE_MID_BUTTON_RISING_EDGE,//14
    EventDetailTypeVALUE_MID_BUTTON_SINGLE_CLICK,//15
    EventDetailTypeVALUE_MID_BUTTON_DOUBLE_CLICK,//16
    EventDetailTypeVALUE_MID_BUTTON_LONG_PRESS,//17
    EventDetailTypeVALUE_MID_BUTTON_LONG_RELEASE,//18
    

    
} EventDetailType;

@interface KiwipenEvent : NSObject
@property (nonatomic, assign, readonly) EventType eventType;
@property (nonatomic, assign, readonly) EventDetailType eventDetailType;
@property (nonatomic, strong, readonly) NSData *eventData;

//根据接收到的nsdata数据把它转变成可以被判断的事件
+ (instancetype) CreateEventWithData:(NSData *) data;

+ (instancetype) CreateEventWithType:(EventType) type AndData:(NSData *) data;

//根据接收数据生成的事件判断对应的是几号消息
- (void)doMethodsJudgingByEventTypeAndEventDetailTypeOfKiwipenEvent;
@end
